﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Study.API.Controllers
{
    /// <summary>
    /// 学习的API接口
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class StudyController : ControllerBase
    {
        /// <summary>
        /// 功能一
        /// </summary>
        /// <param name="name">姓名</param>
        /// <returns>姓名</returns>
        [HttpGet]
        public IActionResult Fun1(string name)
        {
            return Ok(name);
        }
        /// <summary>
        /// 功能二
        /// </summary>
        /// <returns>字符串</returns>
        [HttpPost]
        public IActionResult Fun2()
        {
            //添加一个数据 假设
            return Ok("董家驿好好学习");
        }
    }
}

///路由访问地址 "api/[controller]/[action]"
///http://... /api/Study/Fun1